Optimal. Leaf size=56 \[ -\frac {3 a^3 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}+\frac {4 a^3 \cos (c+d x)}{d (1-\sin (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {2951, 3855,
3852, 8, 2727} \begin {gather*} -\frac {a^3 \cot (c+d x)}{d}+\frac {4 a^3 \cos (c+d x)}{d (1-\sin (c+d x))}-\frac {3 a^3 \tanh ^{-1}(\cos (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2727
Rule 2951
Rule 3852
Rule 3855
Rubi steps
\begin {align*} \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^3 \, dx &=a^2 \int \left (3 a \csc (c+d x)+a \csc ^2(c+d x)-\frac {4 a}{-1+\sin (c+d x)}\right ) \, dx\\ &=a^3 \int \csc ^2(c+d x) \, dx+\left (3 a^3\right ) \int \csc (c+d x) \, dx-\left (4 a^3\right ) \int \frac {1}{-1+\sin (c+d x)} \, dx\\ &=-\frac {3 a^3 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {4 a^3 \cos (c+d x)}{d (1-\sin (c+d x))}-\frac {a^3 \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}\\ &=-\frac {3 a^3 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^3 \cot (c+d x)}{d}+\frac {4 a^3 \cos (c+d x)}{d (1-\sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.45, size = 96, normalized size = 1.71 \begin {gather*} \frac {a^3 \left (-\cot \left (\frac {1}{2} (c+d x)\right )-6 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+6 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {16 \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}+\tan \left (\frac {1}{2} (c+d x)\right )\right )}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.20, size = 89, normalized size = 1.59
method | result | size |
derivativedivides | \(\frac {a^{3} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+3 a^{3} \left (\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+3 a^{3} \tan \left (d x +c \right )+\frac {a^{3}}{\cos \left (d x +c \right )}}{d}\) | \(89\) |
default | \(\frac {a^{3} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+3 a^{3} \left (\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+3 a^{3} \tan \left (d x +c \right )+\frac {a^{3}}{\cos \left (d x +c \right )}}{d}\) | \(89\) |
risch | \(\frac {-10 a^{3}-2 i a^{3} {\mathrm e}^{i \left (d x +c \right )}+8 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) d}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}\) | \(109\) |
norman | \(\frac {\frac {a^{3}}{2 d}-\frac {15 a^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {25 a^{3} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {24 a^{3} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {25 a^{3} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {15 a^{3} \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {a^{3} \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {8 a^{3} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {8 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {24 a^{3} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {3 a^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(240\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 88, normalized size = 1.57 \begin {gather*} \frac {3 \, a^{3} {\left (\frac {2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, a^{3} {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + 6 \, a^{3} \tan \left (d x + c\right ) + \frac {2 \, a^{3}}{\cos \left (d x + c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 194 vs.
\(2 (54) = 108\).
time = 0.38, size = 194, normalized size = 3.46 \begin {gather*} -\frac {10 \, a^{3} \cos \left (d x + c\right )^{2} + 2 \, a^{3} \cos \left (d x + c\right ) - 8 \, a^{3} + 3 \, {\left (a^{3} \cos \left (d x + c\right )^{2} - a^{3} + {\left (a^{3} \cos \left (d x + c\right ) + a^{3}\right )} \sin \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 3 \, {\left (a^{3} \cos \left (d x + c\right )^{2} - a^{3} + {\left (a^{3} \cos \left (d x + c\right ) + a^{3}\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 2 \, {\left (5 \, a^{3} \cos \left (d x + c\right ) + 4 \, a^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left (d \cos \left (d x + c\right )^{2} + {\left (d \cos \left (d x + c\right ) + d\right )} \sin \left (d x + c\right ) - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 98, normalized size = 1.75 \begin {gather*} \frac {6 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 14 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.97, size = 86, normalized size = 1.54 \begin {gather*} \frac {3\,a^3\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a^3-17\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}+\frac {a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________